import request from '@/utils/request'

// 开始巡检
export function startCheck(planId, userArchiveId) {
    return request({
      url: `/${planId}/startCheckInfo/${userArchiveId}`,
      method: 'get'
    })
}

// 查询巡检记录列表
export function listCheckRecords(actionId) {
  return request({
    url: `/guard/actionItems/listForAction/${actionId}`,
    method: 'post'
  })
}

// 新增巡检记录
export function addCheckRecord(data) {
  return request({
    url: '/api/check-record',
    method: 'post',
    data: data
  })
}

// 修改巡检记录
export function updateCheckRecord(data) {
  return request({
    url: '/api/check-record',
    method: 'post',
    data: data
  })
}

// 删除巡检记录
export function delCheckRecord(recordId) {
  return request({
    url: `/guard/actionItems/remove?ids=${recordId}`,
    method: 'post'
  })
}